package com.ease.archiecture.vo;

/**
 * @author wei.jiang
 * @since 19-9-17 上午11:52
 */

public class RespVo {

    public final int status;

    public final String message;

    public final Object data;


    private RespVo(int status, String message, Object data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

    private RespVo(int status, String message) {
        this(status, message, null);
    }

    public static RespVo success(Object data) {
        return new RespVo(1, "success", data);
    }

    public static RespVo fail(String message, Object data) {
        return new RespVo(-1, message, data);
    }

    public static RespVo fail(String message) {
        return new RespVo(-1, message);
    }

    public static RespVo fail() {
        return new RespVo(-1, "fail");
    }
}
